package com.trkj.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.trkj.enmu.LeaveType;

/**
 * The persistent class for the leave database table.
 * 
 */
@Entity
@Table(name="askleave")
public class Leave implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "leave_id")
	private int leaveId;

	@Column(name = "leave_day")
	private int leaveDay;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "leave_endtime")
	private Date leaveEndtime;

	@Lob
	@Column(name = "leave_explain")
	private String leaveExplain;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "leave_starttime")
	private Date leaveStarttime;

	@Column(name = "leave_type")
	@Enumerated(EnumType.STRING)
	private LeaveType leaveType;

	@Temporal(TemporalType.DATE)
	@Column(name = "leave_uptime")
	private Date leaveUptime;
	
	@Column(name="lunch_people")
	private Integer lunchPeople;

	// bi-directional many-to-one association to Dept
	@ManyToOne
	@JoinColumn(name = "dept_id")
	private Dept dept;

	// bi-directional many-to-one association to Emp
	@ManyToOne
	@JoinColumn(name = "emp_id")
	private Emp emp;

	// bi-directional many-to-one association to Position
	@ManyToOne
	@JoinColumn(name = "position_id")
	private Position position;

	public Leave() {
	}

	public Integer getLunchPeople() {
		return lunchPeople;
	}

	public void setLunchPeople(Integer lunchPeople) {
		this.lunchPeople = lunchPeople;
	}

	public int getLeaveId() {
		return this.leaveId;
	}

	public void setLeaveId(int leaveId) {
		this.leaveId = leaveId;
	}

	public int getLeaveDay() {
		return this.leaveDay;
	}

	public void setLeaveDay(int leaveDay) {
		this.leaveDay = leaveDay;
	}

	public Date getLeaveEndtime() {
		return this.leaveEndtime;
	}

	public void setLeaveEndtime(Date leaveEndtime) {
		this.leaveEndtime = leaveEndtime;
	}

	public String getLeaveExplain() {
		return this.leaveExplain;
	}

	public void setLeaveExplain(String leaveExplain) {
		this.leaveExplain = leaveExplain;
	}

	public Date getLeaveStarttime() {
		return this.leaveStarttime;
	}

	public void setLeaveStarttime(Date leaveStarttime) {
		this.leaveStarttime = leaveStarttime;
	}

	public LeaveType getLeaveType() {
		return leaveType;
	}

	public void setLeaveType(LeaveType leaveType) {
		this.leaveType = leaveType;
	}

	public Date getLeaveUptime() {
		return this.leaveUptime;
	}

	public void setLeaveUptime(Date leaveUptime) {
		this.leaveUptime = leaveUptime;
	}

	public Dept getDept() {
		return this.dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	public Emp getEmp() {
		return this.emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	public Position getPosition() {
		return this.position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

}